using System.Text;

namespace zevenseas.Community.Search
{
    public class WhereProperty
    {
        private string property;
        private LogicalOperators? propertyOperator;

        public LogicalOperators? PropertyOperator
        {
            get { return propertyOperator; }
            set { propertyOperator = value; }
        }

        public string Property
        {
            get { return property; }
            set { property = value; }
        }

        protected string GetOperator()
        {
            StringBuilder whereProperty = new StringBuilder();

            switch (propertyOperator)
            {
                case LogicalOperators.AND:
                    whereProperty.Append(" AND ");
                    break;
                case LogicalOperators.OR:
                    whereProperty.Append(" OR ");
                    break;
                case LogicalOperators.ANDNOT:
                    whereProperty.Append(" AND NOT ");
                    break;
                case LogicalOperators.ORNOT:
                    whereProperty.Append(" OR NOT ");
                    break;
                default:
                    break;
            }

            return whereProperty.ToString();
        }

        public override string ToString()
        {
            return "NotImplemented";
        }

        public string ToString(bool IncludeOperator)
        {
            return GetOperator() + ToString();
        }
    }
}